package com.dunshan.prcexp.controller;

import com.alibaba.fastjson.JSON;
import com.dunshan.prcexp.mapper.ChannelDataMpper;
import com.dunshan.prcexp.pojo.ChannelData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author liwen406
 * @program: dunshan-pef
 * @description:
 * @date 2022-08-23 14:01:20
 */
@RestController
public class IndexController {

    @Autowired
    ChannelDataMpper channelDataMpper;

    @GetMapping("")
    public Object toIndex() {
        HashMap<String, Object> map = new HashMap<>();
        map.put("ok", "data");
        return map;
    }


    @GetMapping("sql")
    public Object sqliVerify(int id) {
        ChannelData channelData = channelDataMpper.selectById(id);
        return JSON.toJSONString(channelData);
    }

}
